#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
  printf("i am a proc,my PID:%d,my PPID:%d\n",getpid(),getppid());
  sleep(3);

  pid_t id = fork();
  if(id > 0)
  {
    while(1)
    {
      printf("i am a father,my PID:%d,my PPID:%d\n",getpid(),getppid());
      sleep(2);
    }
  }
  else
  {
    int cnt =3;
    while(cnt--)
    {
      printf("i am a child,my PID:%d,my PPID:%d\n",getpid(),getppid());
      sleep(2);
    }
    exit(0);
  }
}

